from rest_framework.permissions import BasePermission


class IsAdminUser(BasePermission):
    """公司职员"""

    def has_permission(self, request, view):
        return bool(request.user and request.user.is_staff)


class IsNormalUser(BasePermission):
    """普通用户"""

    def has_permission(self, request, view):
        return bool(request.user)


class IsSuperUser(BasePermission):
    """超级管理员"""

    def has_permission(self, request, view):
        return bool(request.user and request.user.is_superuser)